package com.zyj.myapplication.Model;

import com.zyj.myapplication.Javabean.Search;
import com.zyj.myapplication.Service.SearchService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/10/18.
 */

public class SearchModel {
    private Retrofit retrofit;
    private SearchService searchservice;

    public SearchModel() {
        retrofit = new Retrofit
                .Builder()
                .baseUrl(Constant.BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    private void service() {
        searchservice = retrofit.create(SearchService.class);
    }

    public Call getAllsearch() {
        service();
        return searchservice.getAllsearch();
    }
}
